using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Prebaruvanje : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        RN_WebService servis = new RN_WebService();
        loginname.Text = servis.vrati_user(Session["uname"].ToString());
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        RN_WebService servis = new RN_WebService();

        DataSet ds = servis.Prebaruvaj(DropDownList4.SelectedValue.ToString(), DropDownList5.SelectedValue.ToString(), DropDownList6.SelectedValue.ToString());
        GridView1.DataSource = ds.Tables[0];
        GridView1.DataBind();

        if (GridView1.Rows.Count != 0)
        {
            this.SetHeaderText();
            poraka.Text = "";
            poraka.Visible = false;
            Label4.Visible = true;
            Label5.Visible = true;
            Label6.Visible = true;
            lista.Visible = true;
            mesto.Text = DropDownList6.SelectedItem.ToString();
            mesto.Visible = true;
            tip.Text = DropDownList4.SelectedItem.ToString();
            tip.Visible = true;
            kategorija.Text = DropDownList5.SelectedItem.ToString();
            kategorija.Visible = true;

        }
        else
        {
            poraka.Text = "THE  PLAYER HAS NOT A PLACE HE IS IN BR !";
            poraka.Visible = true;
            lista.Visible = false;
            Label4.Visible = false;
            Label5.Visible = false;
            Label6.Visible = false;
            mesto.Visible = false;
            tip.Visible = false;
            kategorija.Visible = false;
        }
    }

    private void SetHeaderText()
    {
        GridView1.HeaderRow.Cells[0].Text = "Number";
        GridView1.HeaderRow.Cells[1].Text = "Lenth";
        GridView1.HeaderRow.Cells[2].Text = "BANK ";
        GridView1.HeaderRow.Cells[3].Text = "Price";
    }
}
